package io.gitee.zhangbinhub.acp.boot.ftp

import io.gitee.zhangbinhub.acp.boot.ftp.conf.AcpFtpServerConfiguration
import io.gitee.zhangbinhub.acp.boot.ftp.init.AcpFtpServerInitialization
import io.gitee.zhangbinhub.acp.boot.ftp.user.UserFactory
import org.springframework.boot.autoconfigure.AutoConfiguration
import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.context.annotation.Bean

/**
 * @since JDK 17
 */
@AutoConfiguration
@EnableConfigurationProperties(
    AcpFtpServerConfiguration::class
)
class AcpFtpAutoConfiguration {

    @Bean
    fun ftpServerInitialization(
        acpFtpServerConfiguration: AcpFtpServerConfiguration,
        userFactory: MutableMap<String, UserFactory>
    ) = AcpFtpServerInitialization(acpFtpServerConfiguration, userFactory)
}
